package com.example.figurehecheng.controller.user;


import com.example.figurehecheng.common.result.Result;
import com.example.figurehecheng.domain.dto.UserDTO;
import com.example.figurehecheng.domain.vo.UserVO;
import com.example.figurehecheng.service.IUserService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 宇科工作室
 * @since 2024-11-29
 */
@RestController("userUserController")
@RequestMapping("/user/user")
@CrossOrigin
@Slf4j
@RequiredArgsConstructor
public class UserController {
     private final IUserService iUserService;

    /**
     * 用户登录与注册
     * @param userDTO
     */
    @PostMapping("/login")
    @ApiOperation("用户登录与注册")
    public Result<UserVO> userLogin(@RequestBody UserDTO userDTO){
        return Result.success(iUserService.userLogin(userDTO));
    }

    @GetMapping("/getall")
    public void getAll(){
//        System.out.println(1);
    }
}
